import Button from "components/Base/Button";
import Icon from "components/Base/Icon";
import DataTable from "components/Base/DataTable";
import Image from "components/Base/Image";
import {rewardTypeDict} from "../../../../models/RewardType";
import {rewardStateDict} from "../../../../models/RewardState";

export default (self) => [

  {
    title: 'id',
    name: 'id',
    formItem: {
      type: 'hidden',
    }
  },

  {
    title: '奖励类型',
    name: 'rewardType',
    tableItem: {
    },
    dict: rewardTypeDict,
  },

  {
    title: "奖励金额",
    name: 'amount',
    tableItem: {
    },
  },

  {
    title: "订单信息",
    name: 'orderId',
    tableItem: {
      render: (text, record) => {
        var path = `/detail/Order/${record.orderId}`;
        return (
          <DataTable.Oper>
            <a onClick={e => {
              self.jump(path);
            }}>
              <span>{record.orderId}</span>
            </a>
          </DataTable.Oper>
        );
      }
    },
  },

  {
    title: "推广用户",
    name: 'shareName',
    tableItem: {
    },
  },


  {
    title: "购买用户",
    name: 'buyName',
    tableItem: {
    },
  },

  {
    title: '状态',
    name: 'rewardState',
    tableItem: {
    },
    dict: rewardStateDict,
  },

  {
    title: "订单完成时间",
    name: 'sucessTime',
    tableItem: {
    },
  },

  {
    title: "充入余额时间",
    name: 'sendUserTime',
    tableItem: {
    },
  },

  {
    title: "备注",
    name: 'remark',
    tableItem: {
    },
  },

  // {
  //   title: '操作',
  //   tableItem: {
  //     width: 180,
  //     align: 'center',
  //     render: (text, record) => (
  //       <DataTable.Oper>
  //         <Button tooltip="修改" onClick={e => self.onUpdate(record)}>
  //           <Icon type="edit"/>
  //         </Button>
  //         <Button tooltip="删除" onClick={e => self.onDelete(record)}>
  //           <Icon type="trash"/>
  //         </Button>
  //       </DataTable.Oper>
  //     )
  //   }
  // }
]
